﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Heavy_Metals
{
    public partial class YJYC_XSLSMX : Form
    {
        public YJYC_XSLSMX()
        {
            InitializeComponent();
        }

        private void YJYC_XSLSMX_Load(object sender, EventArgs e)
        {
            DataGridViewLinkColumn lc = new DataGridViewLinkColumn();
            lc.Text = "事故应急预测";
            lc.Name = "事故应急预测";
            lc.HeaderText = "事故应急预测";
            lc.Width = 60;
            this.dataGridView1.Columns.Add("模型名称", "模型名称");
            this.dataGridView1.Columns.Add("污染物名称", "污染物名称");
            this.dataGridView1.Columns.Add("泄漏量", "泄漏量(kg)");
            this.dataGridView1.Columns.Add("风险源名称", "风险源名称");
            this.dataGridView1.Columns.Add("模拟上段面", "模拟上段面");
            this.dataGridView1.Columns.Add("模拟下断面", "模拟下断面");
            this.dataGridView1.Columns.Add("流量", "流量(m³/s)");
            this.dataGridView1.Columns.Add("平均误差", "平均误差");
            this.dataGridView1.Columns.Add("可靠度", "可靠度");
            this.dataGridView1.Columns.Add("备注", "备注");
            this.dataGridView1.Columns.Add(lc);
            this.dataGridView1.Rows.Add("TABS-MB", "硝基苯", "10000", "", "朱顺屯", "巴彦港", "900", "5", "95%", "应急预案", "预测");
            this.dataGridView1.Rows.Add("ARIMA", "砷", "5000", "", "鸡西", "松花江", "", "7", "94%", "常规预案", "预测");
            this.dataGridView1.Rows.Add("二维模型", "砷", "5000", "", "鸡西", "松花江", "", "7", "94%", "常规预案", "预测");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = "";
            this.textBox2.Text = "";
            this.textBox3.Text = "";
            this.textBox4.Text = "";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.dataGridView1.Rows.Clear();
            this.dataGridView1.Rows.Add("TABS-MB", "硝基苯", "10000", "", "朱顺屯", "巴彦港", "900", "5", "95%", "应急预案", "预测");
            DataTable dt = new DataTable();
            dt.Columns.Add("444444");
        }

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != -1)
            {
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "事故应急预测" && this.dataGridView1.Rows[e.RowIndex].Cells[0].Value == "二维模型")//超链接事件
                {
                    WRYC_EW yc = new WRYC_EW();
                    yc.Show();
                }
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "事故应急预测" && this.dataGridView1.Rows[e.RowIndex].Cells[0].Value == "ARIMA")//超链接事件
                {
                    WRYC_ARIMA yc = new WRYC_ARIMA();
                    yc.Show();
                }
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "事故应急预测" && this.dataGridView1.Rows[e.RowIndex].Cells[0].Value == "TABS-MB")
                {
                    System.Diagnostics.Process.Start("D:/English.exe");
                }
            }
        }
    }
}
